package com.web3.management.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.util.Date;

/**
 * Tampermonkey 客户端实例
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "tm_clients")
public class TmClient extends BaseEntity {

    @Column(name = "client_id", nullable = false, unique = true, length = 64)
    private String clientId;

    @Column(name = "account_id")
    private Integer accountId;

    @Column(name = "status", nullable = false, length = 32)
    private String status = "ACTIVE";

    @Column(name = "remark", length = 255)
    private String remark;

    @Column(name = "last_seen_at")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastSeenAt;

    @Column(name = "last_command_at")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastCommandAt;
}
